package com.leqicheng.tenon.log;

import java.util.HashMap;
import java.util.Map;

import org.apache.cordova.CordovaPlugin;

import android.app.Activity;
import android.content.Context;

import com.leqicheng.tenon.model.EntryInfoModel;
import com.leqicheng.tenon.util.HttpRequest;
import com.leqicheng.tenon.util.LogHttpRequest;
import com.leqicheng.tenon.util.RequestTypeEnum;

public class LogHertbeatPost extends LogHttpRequest {

    private final Context mContext;

    public LogHertbeatPost(Context context, Activity activity) {
        super(context, activity);
        this.mContext = context;
    }

    public String postRequest(EntryInfoModel model) {
        Map<String, String> Data = new HashMap<String, String>();
        RequestTypeEnum requestType = RequestTypeEnum.LOG_POST;
        if (model.getTenonUserId() != null && !model.getTenonUserId().equals("")) {
            Data.put("user_id", model.getTenonUserId());
        }
        Data.put("log_id", model.getLogId());
        String requestUriType = "log-heartbeat";
        this.LogPostOnBack(requestType, Data, requestUriType);
        return requestUriType;
    }
}
